Upload Attachments to Entities
Overview
This document outlines the process for uploading attachments to entities mentioned in a comment using SyncNow DevOps Gate APIs.
Example Scenarios
- Upload logs or attach a report to a security scan and a bug opened from any system.
- Attach a build report to an entity.
Request
The request URL should contain the system ID, which can be copied from the DevOps Process definition page.
POST /api/v1.0/app/DevOpsGate/Enrich/{DevOpsProjectID}/Attachment
The payload should be in form-data
or x-www-form-urlencoded
format.
Parameter | Description |
---|---|
comments | Comment containing the entity IDs to update with #{Entity ID} , e.g., "String with updated entity keys is ready for other DevOps Gate APIs, #CLS-3933, #CLS-3938". |
attachments | A file blob with the first attachment. |
attachments | Additional attachments can be added with the same parameter name. |
Response
This is the response for the comment "String with updated entity keys is ready for other DevOps Gate APIs, #CLS-3933, #CLS-3938".
{
"updatedEntitiesID": [
{
"systemID": "10",
"entityKeys": [
{
"entityKey": "CLS-3933",
"attachmentsID": [
"32013"
]
},
{
"entityKey": "CLS-3938",
"attachmentsID": [
"32014"
]
}
]
}
],
"errors": [],
"warnings": []
}
Parameter | Description |
---|---|
updatedEntitiesID | An array of updated entities. |
systemID | The system where the entities were updated. |
entityKeys | The updated entity keys, including the entity ID and the created attachment ID. |
errors | Errors that occurred during the attachment process. |
warnings | Warnings that occurred during the attachment process. |
Step-by-Step Instructions
- Create a DevOps Gate Process.
- Create two entities in the target system that should be updated by the DevOps Gate.
- Go to the DevOps Gate Process Configuration and add two allowed projects (for demonstration purposes).
- Press the "How It Works" link.
- Select "Upload Attachments".
- Copy the cURL command.
- Paste the cURL command into a command line, set the entity keys of the created entities, and execute.
- Attachments will be uploaded to all entities mentioned in the commits or by the pull request